package com.moss.cloud.log.controller;

import com.moss.cloud.common.core.constant.ServiceList;
import com.moss.cloud.common.core.model.Result;
import com.moss.cloud.log.model.param.OpsLogParam;
import com.moss.cloud.log.service.IOperationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * 操作日志前端控制器
 *
 * @author 瑾年
 * @date 2023年11月13日
 */
@Slf4j
@RestController
@RequestMapping(ServiceList.LOG + "/opsLog")
public class OpsLogController {
    private IOperationLogService operationLogService;

    public OpsLogController(IOperationLogService operationLogService) {
        this.operationLogService = operationLogService;
    }


    /**
     * 系统操作日志列表
     *
     * @param opsLogParam
     * @return
     */
    @PostMapping("/opsLogPage")
    public Mono<Result<?>> opsLogPage(@RequestBody OpsLogParam opsLogParam) {
        return Mono.just(Result.success(operationLogService.opsLogPage(opsLogParam)));
    }
}
